package com.imooc.order.service;

import com.imooc.order.dto.OrderDTO;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;

/**
 * @author steve
 * @date 2020/6/16 11:25
 */
public interface OrderService {

    /**
     * 创建订单
     * @param orderDTO
     * @return
     */
    OrderDTO create(OrderDTO orderDTO);

    /**
     * 查询单个订单
     * @param orderId
     * @return
     */
    OrderDTO findOrderById(String orderId);

    /**
     * 查询所有订单数据(根据买家微信openid)
     * @param buyerOpenid 买家微信openId
     * @param pageable
     * @return
     */
    Page<OrderDTO> findAll(String buyerOpenid, Pageable pageable);

    /**
     * 取消订单
     * @param orderDTO
     * @return
     */
    OrderDTO cancel(OrderDTO orderDTO);

    /**
     * 完结订单
     * @param orderId
     * @return
     */
    OrderDTO finished(String orderId);


}
